﻿using System;
using System.Windows;

namespace SunwellLauncher
{
    /// <summary>
    /// Interaction logic for Realmlist.xaml
    /// </summary>
    public partial class Realmlist : Window
    {
        private static volatile Realmlist instance;
        private static object syncRoot = new Object();

        public Realmlist()
        {
            InitializeComponent();
        }

        public static Realmlist Instance
        {
            get 
            {
                if (instance == null) 
                {
                    lock (syncRoot) 
                    {
                        if (instance == null)
                            instance = new Realmlist();
                    }
                }
                return instance;
            }
        }

        private void Realmlists_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!MainWindow.closeStoryBoardCompleted)
            {
                //Storyboard closeStoryBoard = FindResource("closeStoryBoard") as Storyboard;
                //closeStoryBoard.Begin();
                e.Cancel = true;
            }
        }
    }
}
